<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>weakmap的使用</title>
</head>
<body>
  <script>
    let obj1 = {name: "james"}
    let obj2 = {name: "kobe"}

    const weakMap = new WeakMap()
    weakMap.set(obj1,"222")
    weakMap.set(obj2,"555")

    obj1 = null
    obj2 = null

    console.log(weakMap)
  </script>
</body>
</html>